<?php
namespace API\Controller;
use Think\Controller;
class ActivityController extends Controller {
	//查看所有活动信息接口
    public function getActivities(){


        $activities = M('activities');
        $data = $activities -> order("a_id")->select();

        echo json_encode($data);
         echo "<br>";

    }
    //查看活动详情接口
    public function getActivityById(){
        $a_id = $_GET['a_id'];
        $getActivityById = M('activities');
        $data = $getActivityById ->where("a_id='$a_id'")-> select();

        echo json_encode($data);
         echo "<br>";
     }
}
?>
